<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
</head>
<body>

</body>
</html>

<!-- <script type="text/javascript">
	function qiuhe(n) {
		var sum = 0
		if(n%2==0){
			for (var i = 2; i<=n;i+=2){
                 sum+=1/i;
			}

		}else{
			for (var i =1;i<=n;i+=2){
				sum+=1/i;
			}
		}
		return sum
	}
	alert (qiuhe(4))
</script> -->

<!-- <script type="text/javascript">
	function test() {
		var sum = 0;
		for (var i = 0;i < arguments.length; i++) {
			sum = sum+arguments[i]
		}
		return sum
	}
	alert(test(1,5,7))

</script> -->

<!-- <script type="text/javascript">
	var arr = new Array(100,true,"hello")
	alert(arr)

	var arr2 = [100,true,"hello"]
	alert(arr2)

	var arr3 = new Array(3)
	arr3[0]=1;
	arr3[1]="hello";
	arr3[2]="world"
	alert(arr3)


</script>
 -->


<!-- <script type="text/javascript">
	var arr = new Array(98,true,"hello")
	for (var i in arr) {
		document.write(arr[i]+"<br/>")//列表的取值打印
	}

	// var arr3 = new Array(10)//申明一个长度为10的数值
	// for (var i = 0;i < 3; i++) {
	// 	arr3[i]=parseInt(Math.random()*10)//random函数是0到1字间的数，所以乘以10，有可能有小数，再用parseInt取整数
	// }
	// arr3[0]=1;
	// arr3[1]="hello";
	// arr3[2]="world"
	//alert(arr3)
</script> -->

<!-- <script type="text/javascript">

	var arr = ["北京","上海","广州"];
	//var res = arr.push("成都","深圳","杭州")//从尾部插
	var res = arr.unshift("成都");//从头部插
	alert(arr)
	alert(res)
</script> -->

<!-- <script type="text/javascript">
	var arr1 = [10,20,30];
	var arr2 = [40,50,60];
	var newarr = arr1.concat(arr2,true,"hello")//arr1把arr2拷贝进去
	alert(newarr)
	alert(arr1)
</script> -->

<script type="text/javascript">
	var arvage;
	var sum=0;
	var sum2 =0;
	var newarr = []
	var arr = new Array(30);
	for (var i = 1; i < 30;  i++) {
		arr[i]=2*(i+1)
	}
	alert(arr)

	for (var j=0;j<30;j++ ) {
		sum = sum + arr[j]
		if (j+1)%5==0 {
			arvage=(sum-sum2)/5;
			newarr.push(arvage)
			document.write(arvage+"<br/>")
			var sum2 = sum;
		}
	}


</script>